#include <REGX52.H>

void Timer0_Init()
{
	TMOD&=0xf0;
	TMOD|=0x01;
	TL0 = 0x66;		//设置定时初值
	TH0 = 0xFC;		//设置定时初值
	TR0=1;
	TF0=0;
	ET0=1;
	EA=1;
	PT0=0;
}
void Timer1_Init()
{
	TMOD&=0x0f;
	TMOD|=0x10;
	TL1 = 0xCD;		//设置定时初值
	TH1 = 0xD4;		//设置定时初值
	TR1=1;
	TF1=0;
	ET1=1;
	EA=1;
	PT1=0;
}


//void Timer0_Routine() interrupt 1
//{
//	static Timer0_Count=0;
//	Timer0_Count++;
//	TL0 = 0x66;		//设置定时初值
//	TH0 = 0xFC;		//设置定时初值
//	if(Timer0_Count==1000)
//	{
//		Timer0_Count=0;
//		P2=~P2;
//	}
//}